package com.orange.protoTypePatterns.deepCopyToImp;

import lombok.Data;

import java.io.Serializable;

@Data
public class PojoToTest implements Cloneable, Serializable {
    private String name;

    @Override
    public PojoToTest clone() {
        try {
            PojoToTest clone = (PojoToTest) super.clone();
            //设置属性
            clone.setName("我是新的对象");
            return clone;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }
}
